<?php
	require("includes/basic.php");
	if(!isset($_SESSION['uid']) && $userType!='O')
	{
		header("location:authorise.php");
	}
?>

<HTML>
	<HEAD>
		
		<TITLE> :: <?php echo $appName?> :: </TITLE>
		<link rel='stylesheet' type='text/css' href='style/inner.css'>
		<link rel='stylesheet' type='text/css' href='style/admin.css'>
		<script type='text/javascript' src='js/inner.js'></script>
	</HEAD>

	<body> 
		<?php $pageName="Administration View"; ?>
		<?php require("includes/header.php"); ?>
<?php 
$cli=$_REQUEST['cli'];

$clidetails=mysql_query("SELECT * FROM client_master WHERE client_id=$cli");

while($row=mysql_fetch_array($clidetails))
{

	$cliname=$row['client_name'];
$cli_desc=$row['client_description'];
$uname=$row['user_name'];
$pass=base64_decode($row['password']);
$type=$row['client_type'];
$clitypeid=$row['usertypeid'];
$created=$row['client_created_on'];
$record=$row['record_status'];


?>
		
<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td id='screenH'>
		<div class='pathbar'><a href='index.php'>Admin</a> -> <a href="view-clients.php">Clients</a> -> <?php echo $cliname;?></div>
		<div class='screenTitle'>
			<table width='100%' cellspacing='0'>
				<tr>
					<td>
						<?php echo "Client Details";?>
					</td>		
				</tr>
			</table>
		</div>
</table>	
		
       
		
		
        
<?php	


	

//extract($row);

?>


	<center>
<table>
<tr><td style="height:10px;">&nbsp;</td></tr>
</table>

	<table border="0" width="90%" style="border:1px solid #E0DFE3;" cellspacing="0" >

	
	
<tr><td colspan="2" align="left" style="border-bottom:1px solid #E0DFE3;padding:5px;font-weight:bold;font-size:13px;background-color:#E0DFE3;">Client Details</td></tr>


<tr>
<td colspan="2" style="border-bottom:1px solid #E0DFE3;height:60px;padding-left:10px;">

<?php
$sql = mysql_query("select * from client_logo where client_id='$clitypeid'");
if(mysql_num_rows($sql)>0)
{
	echo "<img src='getlogo.php?id=$clitypeid'>";
}
else
{
   echo "No logo added";
}
	?>

</td>
</tr>

<tr >
	<td class="open">Client</td>
    <td class="open_data"><?php echo $cliname; ?></td>
</tr>
<tr class=''>
	<td class="open">Client Description</td>
    <td class="open_data"><?php echo $cli_desc; ?></td>
</tr>

<tr >
	<td class="open">User Name</td>
    <td class="open_data"><?php echo $uname; ?></td>
</tr>

<tr>
	<td class="open">Password</td>
    <td class="open_data"><?php echo $pass; ?></td>
</tr>
<tr>
	<td class="open">Record Status</td>
    <td class="open_data">
	<?php
	if($record=='Y')
	{
	echo 'Yes';
	}
	else
	{
		echo 'No';
	}
	?>
	</td>
</tr>
<?php 
$pro=mysql_query("SELECT * FROM client_project WHERE client_id='$clitypeid'");
$pro_ro=mysql_num_rows($pro);



?>
<tr >
	<td class="open">No. of Projects</td>
    <td class="open_data"><?php echo $pro_ro; ?></td>
</tr>

<?php 
$con=mysql_query("SELECT * FROM client_contact WHERE client_id='$clitypeid'");
$ro=mysql_fetch_array($con);
//extract($ro);
$contact_name=$ro['contact_name'];
$ph1=$ro['contact_phone_1'];
$ph2=$ro['contact_phone_2'];
$e1=$ro['contact_email_1'];
$e2=$ro['contact_email_2'];
$add=$ro['contact_address'];
$re=$ro['record_status'];
$con_created=$ro['contact_created_on'];




?>

<tr >
	<td class="open">Client Contact Name</td>
    <td class="open_data"><?php echo $contact_name; ?></td>
</tr>

<tr>
	<td class="open">Contact Phone 1</td>
    <td class="open_data"><?php echo $ph1; ?></td>
</tr>

<tr >
	<td class="open">Contact Phone 2</td>
    <td class="open_data"><?php echo $ph2; ?></td>
</tr>

<tr>
	<td class="open">Contact Email 1</td>
    <td class="open_data"><?php echo $e1; ?></td>
</tr>

<tr >
	<td class="open">Contact Email 2</td>
    <td class="open_data"><?php echo $e2; ?></td>
</tr>

<tr>
	<td class="open">Contact Address</td>
    <td class="open_data"><?php echo $add; ?></td>
</tr>

<tr >
	<td class="open">Contact Record Status</td>
    <td class="open_data"><?php 
		if($re=='Y')
		{
			echo 'Yes';
		}
		else
	{
			echo 'No';
	}
	?></td>
</tr>
<?php 

}
?>
	</table>
 
	</center>
	<style>
	.footer{
		bottom:0px;
		position:absolute;
	}
	</style>
		<?php require("includes/footer.php"); ?>
	</BODY>
</HTML>
